<template lang="pug">
    .index-page
        div(class="nav base-line--bottom")
            .site
                a 智能目录
                a 官网首页
            .user
                mt-button(type="primary") 登录
                span.msg 通知 (0)
        div(class="banner")
            img(src="http://c1.51cjml.com/c3/manufacturerlogo/000/672/408.jpg")
        div(class="search-box")
            mt-navbar(v-model="selected")
                mt-tab-item(id="1",@click.native="toSearch") 按车型
                mt-tab-item(id="2") VIN码
                mt-tab-item(id="3") OE号
                mt-tab-item(id="4") 编号
                mt-tab-item(id="5") 发动机号
            div(class="search-panel base-line--surround")
                div(class="search-field")
                    mt-field(v-model="searchTxt",placeholder="点击选择“车型”",v-if="selected==='1'",@click.native="toSearch")
                    mt-field(v-model="searchTxt",placeholder="请输入或手机扫描VIN码查询",v-if="selected==='2'")
                    mt-field(v-model="searchTxt",placeholder="请输入OE号查询",v-if="selected==='3'")
                    mt-field(v-model="searchTxt",placeholder="请输入厂商编码查询",v-if="selected==='4'")
                    mt-field(v-model="searchTxt",placeholder="请输入发动机型号查询",v-if="selected==='5'")
                div(class="search-button base-line--left",@click="toSearch") 查
            div(class="search-content")
                div(class="no-msg")
                    img(src="http://c1.51cjml.com/c3/categoryicon/000/662/441.png")
                    p 过滤器
</template>

<script>
export default {
  name: '',
  data () {
    return {
      selected: '1',
      searchTxt: ''
    }
  },
  components: {

  },
  watch: {
    selected: function (val) {
      this.searchTxt = ''
    }
  },
  mounted () {

  },
  methods: {
    toSearch () {
      this.$router.push({
        name: 'search',
        query: {
          menu: this.selected,
          keys: this.searchTxt
        }
      })
    }
  }
}
</script>

<style scoped lang="scss" >
.index-page{
    height: 100%;
    background: #fff;
    .nav{
        display: flex;
        height: 80px;
        align-items: center;
        justify-content: space-between;
        padding:0 20px ;
        background: #fff;
        font-size: 12px;
        .site a{
            padding-right: 12px;
        }
        .user span.msg{
            padding-left: 20px;
        }
    }
    .banner{
        img{
            width: 100%;
        }
    }
    .search-panel{
        width: 95%;
        background: #fff;
        height: 80px;
        margin: 12px auto;
        font-size: 32px;
        display: flex;
        .search-field{
            flex: 1;
            box-sizing: border-box;
        }
        .keys-list{
            padding: 0 20px;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            button{
                margin-right: 8px;
                i{
                    padding-left: 6px;
                }
            }
        }
        .search-button{
            width: 80px;
            line-height: 80px;
            text-align: center;
        }
        .clean-search{
            color: #999;
        }
    }
    .search-content{
        display: flex;
        align-items: center;
        justify-content: center;
        height: 400px;
        .no-msg{
            font-size: 14px;
            text-align: center;
            img{
                display: block;
                width: 90px;
            }
            p{
                line-height: 80px;
            }
        }
    }
}
</style>
